﻿// Decompiled with JetBrains decompiler
// Type: Seams.Seam
// Assembly: Seam, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 7B6A1A2D-ABD9-437A-AFED-EC4D22501F73
// Assembly location: C:\Users\KasimGulcan\Desktop\Kosgeb\DynaCAD\Project\DynaCAD\abin\Debug\Seam.dll

using PathOperations;
using System;
using System.Windows;
using System.Windows.Media;
using System.Windows.Shapes;

namespace Seams
{
  public class Seam : Shape
  {
    public static readonly DependencyProperty PathDataProperty = DependencyProperty.Register("PathDataSeam", typeof (Geometry), typeof (Seam), (PropertyMetadata) new FrameworkPropertyMetadata((object) new PathGeometry(), FrameworkPropertyMetadataOptions.AffectsMeasure));
    public static readonly DependencyProperty YonProperty = DependencyProperty.Register("Yön", typeof (Seam.YonTipi), typeof (Seam), (PropertyMetadata) new FrameworkPropertyMetadata((object) Seam.YonTipi.Iç, FrameworkPropertyMetadataOptions.AffectsMeasure));
    public static readonly DependencyProperty DikişAralığıProperty = DependencyProperty.Register("DıkısAralıgı", typeof (double), typeof (Seam), (PropertyMetadata) new FrameworkPropertyMetadata((object) 5.0, FrameworkPropertyMetadataOptions.AffectsMeasure));
    public static readonly DependencyProperty DikişTipiProperty = DependencyProperty.Register("DıkısSayısı", typeof (Seam.DikişTipi), typeof (Seam), (PropertyMetadata) new FrameworkPropertyMetadata((object) Seam.DikişTipi.Tek, FrameworkPropertyMetadataOptions.AffectsMeasure));
    public Path P;
    public GeometryGroup GG;

    public Geometry PathData
    {
      get
      {
        return (Geometry) this.GetValue(Seam.PathDataProperty);
      }
      set
      {
        this.SetValue(Seam.PathDataProperty, (object) value);
        this.P.Data = value;
      }
    }

    public Seam.YonTipi Yon
    {
      get
      {
        return (Seam.YonTipi) this.GetValue(Seam.YonProperty);
      }
      set
      {
        this.SetValue(Seam.YonProperty, (object) value);
      }
    }

    public double DikişAralığı
    {
      get
      {
        return (double) this.GetValue(Seam.DikişAralığıProperty);
      }
      set
      {
        this.SetValue(Seam.DikişAralığıProperty, (object) value);
      }
    }

    public Seam.DikişTipi DikişSayısı
    {
      get
      {
        return (Seam.DikişTipi) this.GetValue(Seam.DikişTipiProperty);
      }
      set
      {
        this.SetValue(Seam.DikişTipiProperty, (object) value);
      }
    }

    protected override Geometry DefiningGeometry
    {
      get
      {
        this.GG.Children.Clear();
        this.GG.Children.Add(this.P.Data);
        for (int index = 1; index < Convert.ToInt32(Convert.ChangeType((object) this.DikişSayısı, this.DikişSayısı.GetTypeCode())); ++index)
          this.GG.Children.Add(Ofset.OfsetPath(new Path()
          {
            Data = this.PathData
          }, this.DikişAralığı * (double) index, this.Yon != Seam.YonTipi.Iç).Data);
        if (this.DikişSayısı == Seam.DikişTipi.Yok)
          this.GG.Children.Clear();
        return (Geometry) this.GG;
      }
    }

    public Seam()
    {
      this.GG = new GeometryGroup();
      this.P = new Path();
    }

    public enum DikişTipi
    {
      Yok,
      Tek,
      Çift,
    }

    public enum YonTipi
    {
      Iç,
      Dış,
    }
  }
}
